package com.xltt.vehicleControl.bean;


import java.io.Serializable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class RemoteControlRequest  implements Serializable {
    public static final String SERVICE_ID_RHL = "RHL";
    public static final String SERVICE_ID_RDL = "RDL";
    public static final String SERVICE_ID_RDU = "RDU";
    public static final String SERVICE_ID_RTL = "RTL";
    public static final String SERVICE_ID_RTU = "RTU";
    public static final String SERVICE_ID_RES = "RES";
    public static final String SERVICE_ID_RWS = "RWS";
    public static final String SERVICE_ID_RCE = "RCE";
    public static final String SERVICE_ID_RSH = "RSH";
    public static final String SERVICE_ID_DIA = "DIA";
    public static final String SERVICE_ID_RPC = "RPC";
    public static final String SERVICE_ID_MRS = "MRS";
    public static final String SERVICE_ID_JOU = "JOU";
    public static final String SERVICE_ID_RSM = "RSM";
    public static final String SERVICE_ID_RCC = "RCC";
    public static final String SERVICE_ID_REC = "REC";
    public static final String SERVICE_ID_RSV = "RSV";
    public static final String SERVICE_PICK_UP = "PICKUPFRIEND";

	//以下均为v2版
    public static final String SERVICE_ID_RDL_2 = "RDL_2";
    public static final String SERVICE_ID_RDU_2 = "RDU_2";
    public static final String SERVICE_ID_RWS_2 = "RWS_2";
    public static final String SERVICE_ID_RCE_2 = "RCE_2";
    public static final String SERVICE_ID_RDO_2 = "RDO";
    public static final String SERVICE_ID_RDC_2 = "RDC";
    public static final String SERVICE_ID_RFD_2 = "RFD";
    public static final String SERVICE_ID_RQT_2 = "RQT";
    public static final String SERVICE_ID_RCC_2 = "RCC_2";
    //远程充电
    public static final String SERVICE_ID_RCS = "RCS";
    //放电过低
    public static final String SERVICE_ID_DCL = "DCL";
    //泊车异常
    public static final String SERVICE_ID_PARK = "PARK";
    //唤醒TEM
    public static final String SERVICE_ID_RWR = "RWR";

    private String serviceIdStr;
    private String serviceId;
    private String userId;
    private String timestamp;
    private String creator;
    private String pin;
    private String sessionId;
    private String command = "start";
    private Boolean latest;
    private OperationScheduling operationScheduling;
    private List<ServiceParameter> serviceParameters;

    @ServiceId
    private String getServiceIdStr() {
        return this.serviceIdStr;
    }

    public String getPin() {
        return this.pin;
    }

    public void setPin(String pin) {
        this.pin = pin;
    }

    public String getSessionId() {
        return this.sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public Boolean isLatest() {
        return this.latest;
    }

    public void setLatest(Boolean latest) {
        this.latest = latest;
    }

    public RemoteControlRequest(){}

    public RemoteControlRequest(@ServiceId String ServiceId) {
        this.timestamp = String.valueOf((new Date()).getTime());
        this.serviceId = ServiceId;
        this.creator = "tc";
        this.operationScheduling = new OperationScheduling();
    }

    public OperationScheduling getOperationScheduling() {
        return this.operationScheduling;
    }

    public void setOperationScheduling(OperationScheduling operationScheduling) {
        this.operationScheduling = operationScheduling;
    }

    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public void setServiceParameters(List<ServiceParameter> serviceParameters) {
        this.serviceParameters = serviceParameters;
    }

    public void setServiceParameters(ServiceParameter serviceParameter) {
        List<ServiceParameter> list = new ArrayList();
        list.add(serviceParameter);
        this.serviceParameters = list;
    }

    public String getCommand() {
        return this.command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public RemoteControlRequest setStopCommand() {
        this.command = "stop";
        return this;
    }

    public String getServiceId() {
        return this.serviceId;
    }

    public String getUserId() {
        return this.userId;
    }

    public String getTimestamp() {
        return this.timestamp;
    }

    public String getCreator() {
        return this.creator;
    }

    public List<ServiceParameter> getServiceParameters() {
        return this.serviceParameters;
    }

    public int describeContents() {
        return 0;
    }


    @Retention(RetentionPolicy.CLASS)
    public @interface ServiceId {
    }
}

